package cn.ddiancan.xddcloud.ddccore.validator.annotation;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

import cn.ddiancan.xddcloud.ddccore.validator.DateValidator;
import jakarta.validation.Constraint;

@Constraint(validatedBy = DateValidator.class)
@Target({ElementType.METHOD, ElementType.FIELD, ElementType.ANNOTATION_TYPE, ElementType.PARAMETER})
@Retention(RetentionPolicy.RUNTIME)
public @interface ValidDate {

    String message() default "日期格式不正确";

    Class<?>[] groups() default {};

    Class<? extends jakarta.validation.Payload>[] payload() default {};

    String format() default "yyyy-MM-dd HH:mm:ss";

    boolean allowNull() default false;
}
